//void bar0() {

//hi
template<class foo>
void bar1() {
	auto foo = [] {
		auto morefoo = agf[]
	};
}

template<>
//stuff
void bar2<int>() {
}

template<>
// more stuff
void bar3<int *>() {}

template<class A,class C> struct B {
	void a() {}
};
template<> struct B<int, B<double>> {
	void b() {}
}

//!!

//!! (the lack of an image in the above dropdown item is intentional -- i like making it possible to leave "breaks" inside the function list.  sortof like a "#pragma mark -" in XCode.

//!! yet more stuff.

#define foo if(bar) {

void SpaceMap::draw_grid(int resolution, float line_width, sven::rgba c) {
	if(!show_grid) return;

	glPushAttrib(GL_LINE_BIT | GL_CURRENT_BIT | GL_ENABLE_BIT | GL_POLYGON_BIT);
	glEnable(GL_LINE_SMOOTH);
	glDisable(GL_TEXTURE_2D);
	glColor(c);
	glLineWidth ( line_width );
	glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
	glPushMatrix();
	//glTranslatef(0,0,-.1f);


#ifdef USE_VBOS

	ENSURE_GL_EXTENSIONS("GL_ARB_vertex_buffer_object");

	
	std::map<int, GLuint>::const_iterator bi = grid_line_buffers.find(resolution) ;

	GLuint grid_vertices;

	Battle * bc= battle();
	int gw = w/ int(w/bc->grid_x*resolution);
	int gh = h/ int(h/bc->grid_y*resolution);

	if(bi == grid_line_buffers.end()) {

		float * verts = new float[4*(gw + gh)];
		
		int i=0;
		for(float x=0;x<w;x+=w/bc->grid_x*resolution) {
			verts[i++]=x;verts[i++]=0;
			verts[i++]=x;verts[i++]=h;
		}
		for(float y=0;y<h;y+=h/bc->grid_y*resolution) {
			verts[i++]=0;verts[i++]=y;
			verts[i++]=w;verts[i++]=y;
		}
		
		glGenBuffersARB(1, &grid_vertices); 
		glBindBufferARB(GL_ARRAY_BUFFER_ARB, grid_vertices); 
		glBufferDataARB(GL_ARRAY_BUFFER_ARB,sizeof(float)*4*(gw + gh),verts,GL_STATIC_DRAW_ARB);
		glBindBufferARB(GL_ARRAY_BUFFER_ARB,NULL);

		delete [] verts;

		grid_line_buffers[resolution]=grid_vertices;
	}
	else {
		grid_vertices=bi->second;
	}


	glBindBufferARB(GL_ARRAY_BUFFER_ARB, grid_vertices); 

	glVertexPointer(2, GL_FLOAT, 0, 0);

	glEnableClientState(GL_VERTEX_ARRAY);

	glDrawArrays(GL_LINES, 0, 2*(gw+gh));

	glDisableClientState(GL_VERTEX_ARRAY); 
	glBindBufferARB(GL_ARRAY_BUFFER_ARB,NULL);
#else

	glBegin(GL_LINES);
	for(float x=0;x<w;x+=w/bc->grid_x*resolution) {
		glVertex2f(x,0);
		glVertex2f(x,h);
	}
	for(float y=0;y<h;y+=h/bc->grid_y*resolution) {
		glVertex2f(0,y);
		glVertex2f(w,y);
	}
	glEnd();

#endif

	glPopMatrix();
	glPopAttrib();
}

int fooy() {}

template<class B>
struct lark {
	foo()
	lark() {}
	~lark(){}
	int foo() { foreach(bob) {} }
};

SpaceMap::SpaceMap(int bob) : bob(bob) {}

SpaceMap::~SpaceMap()  {}

		void orz::bar::foo(int lark, int bar) {
	for(int i=0;;i++) {
		//more stuff.
	}
	return hi;
}

lark::lark() : hi(2) {
	
}

template<>
struct lark<A,B> {

	struct foo {

		// this get's counted twice, even though it's legal.
		int lark() {}

		//this is illegal, and also gets counted twice.
		void orz::bar::foo(int lark, int bar) {
	for(int i=0;;i++) {
		//more stuff.
	}
	return hi;
}
	};

};

struct bar {
};

// -- hi there
// and stuff
